home *** CD-ROM | disk | FTP | other *** search
/ Belgian Amiga Club - ADF Collection / BS1 part 05.zip / BS1 part 5 / SASC_6.0_Disk_4.adf / Compiler_Headers / Include / dos / dosasl.h < prev    next >
C/C++ Source or Header  |  1992-07-30  |  5KB  |  156 lines

  1. #ifndef DOS_DOSASL_H
  2. #define DOS_DOSASL_H
  3. /*
  4. **
  5. **    $Filename: dos/dosasl.h $
  6. **    $Release: 2.04 Includes, V37.4 $
  7. **    $Revision: 36.16 $
  8. **    $Date: 91/05/02 $
  9. **
  10. **    Pattern-matching structure definitions
  11. **
  12. **    (C) Copyright 1989-1991 Commodore-Amiga, Inc.
  13. **        All Rights Reserved
  14. **
  15. */
  16.  
  17. #ifndef EXEC_LIBRARIES_H
  18. #include <exec/libraries.h>
  19. #endif
  20.  
  21. #ifndef EXEC_LISTS_H
  22. #include <exec/lists.h>
  23. #endif
  24.  
  25. #ifndef DOS_DOS_H
  26. #include <dos/dos.h>
  27. #endif
  28.  
  29.  
  30. /***********************************************************************
  31. ************************ PATTERN MATCHING ******************************
  32. ************************************************************************
  33.  
  34. * structure expected by MatchFirst, MatchNext.
  35. * Allocate this structure and initialize it as follows:
  36. *
  37. * Set ap_BreakBits to the signal bits (CDEF) that you want to take a
  38. * break on, or NULL, if you don't want to convenience the user.
  39. *
  40. * If you want to have the FULL PATH NAME of the files you found,
  41. * allocate a buffer at the END of this structure, and put the size of
  42. * it into ap_Strlen.  If you don't want the full path name, make sure
  43. * you set ap_Strlen to zero.  In this case, the name of the file, and stats
  44. * are available in the ap_Info, as per usual.
  45. *
  46. * Then call MatchFirst() and then afterwards, MatchNext() with this structure.
  47. * You should check the return value each time (see below) and take the
  48. * appropriate action, ultimately calling MatchEnd() when there are
  49. * no more files and you are done.  You can tell when you are done by
  50. * checking for the normal AmigaDOS return code ERROR_NO_MORE_ENTRIES.
  51. *
  52. */
  53.  
  54. struct AnchorPath {
  55.     struct AChain    *ap_Base;    /* pointer to first anchor */
  56. #define    ap_First ap_Base
  57.     struct AChain    *ap_Last;    /* pointer to last anchor */
  58. #define ap_Current ap_Last
  59.     LONG    ap_BreakBits;    /* Bits we want to break on */
  60.     LONG    ap_FoundBreak;    /* Bits we broke on. Also returns ERROR_BREAK */
  61.     BYTE    ap_Flags;    /* New use for extra word. */
  62.     BYTE    ap_Reserved;
  63.     WORD    ap_Strlen;    /* This is what ap_Length used to be */
  64. #define    ap_Length ap_Flags    /* Old compatability for LONGWORD ap_Length */
  65.     struct    FileInfoBlock ap_Info;
  66.     UBYTE    ap_Buf[1];    /* Buffer for path name, allocated by user */
  67.     /* FIX! */
  68. };
  69.  
  70.  
  71. #define    APB_DOWILD    0    /* User option ALL */
  72. #define APF_DOWILD    1
  73.  
  74. #define    APB_ITSWILD    1    /* Set by MatchFirst, used by MatchNext     */
  75. #define APF_ITSWILD    2    /* Application can test APB_ITSWILD, too */
  76.                 /* (means that there's a wildcard     */
  77.                 /* in the pattern after calling         */
  78.                 /* MatchFirst).                 */
  79.  
  80. #define    APB_DODIR    2    /* Bit is SET if a DIR node should be */
  81. #define APF_DODIR    4    /* entered. Application can RESET this */
  82.                 /* bit after MatchFirst/MatchNext to AVOID */
  83.                 /* entering a dir. */
  84.  
  85. #define    APB_DIDDIR    3    /* Bit is SET for an "expired" dir node. */
  86. #define APF_DIDDIR    8
  87.  
  88. #define    APB_NOMEMERR    4    /* Set on memory error */
  89. #define APF_NOMEMERR    16
  90.  
  91. #define    APB_DODOT    5    /* If set, allow conversion of '.' to */
  92. #define APF_DODOT    32    /* CurrentDir */
  93.  
  94. #define APB_DirChanged    6    /* ap_Current->an_Lock changed */
  95. #define APF_DirChanged    64    /* since last MatchNext call */
  96.  
  97. #define APB_FollowHLinks 7    /* follow hardlinks on DODIR - defaults   */
  98. #define APF_FollowHLinks 128    /* to not following hardlinks on a DODIR. */
  99.  
  100.  
  101. struct AChain {
  102.     struct AChain *an_Child;
  103.     struct AChain *an_Parent;
  104.     BPTR    an_Lock;
  105.     struct FileInfoBlock an_Info;
  106.     BYTE    an_Flags;
  107.     UBYTE    an_String[1];    /* FIX!! */
  108. };
  109.  
  110. #define    DDB_PatternBit    0
  111. #define    DDF_PatternBit    1
  112. #define    DDB_ExaminedBit    1
  113. #define    DDF_ExaminedBit    2
  114. #define    DDB_Completed    2
  115. #define    DDF_Completed    4
  116. #define    DDB_AllBit    3
  117. #define    DDF_AllBit    8
  118. #define    DDB_Single    4
  119. #define    DDF_Single    16
  120.  
  121. /*
  122.  * Constants used by wildcard routines, these are the pre-parsed tokens
  123.  * referred to by pattern match.  It is not necessary for you to do
  124.  * anything about these, MatchFirst() MatchNext() handle all these for you.
  125.  */
  126.  
  127. #define P_ANY        0x80    /* Token for '*' or '#?  */
  128. #define P_SINGLE    0x81    /* Token for '?' */
  129. #define P_ORSTART    0x82    /* Token for '(' */
  130. #define P_ORNEXT    0x83    /* Token for '|' */
  131. #define P_OREND    0x84    /* Token for ')' */
  132. #define P_NOT        0x85    /* Token for '~' */
  133. #define P_NOTEND    0x86    /* Token for */
  134. #define P_NOTCLASS    0x87    /* Token for '^' */
  135. #define P_CLASS    0x88    /* Token for '[]' */
  136. #define P_REPBEG    0x89    /* Token for '[' */
  137. #define P_REPEND    0x8A    /* Token for ']' */
  138. #define P_STOP        0x8B    /* token to force end of evaluation */
  139.  
  140. /* Values for an_Status, NOTE: These are the actual bit numbers */
  141.  
  142. #define COMPLEX_BIT    1    /* Parsing complex pattern */
  143. #define EXAMINE_BIT    2    /* Searching directory */
  144.  
  145. /*
  146.  * Returns from MatchFirst(), MatchNext()
  147.  * You can also get dos error returns, such as ERROR_NO_MORE_ENTRIES,
  148.  * these are in the dos.h file.
  149.  */
  150.  
  151. #define ERROR_BUFFER_OVERFLOW    303    /* User or internal buffer overflow */
  152. #define ERROR_BREAK        304    /* A break character was received */
  153. #define ERROR_NOT_EXECUTABLE    305    /* A file has E bit cleared */
  154.  
  155. #endif /* DOS_DOSASL_H */
  156.